import { NgModule } from '@angular/core';
import { Ng2SmartTableModule } from 'ng2-smart-table';

import { ThemeModule } from '../../@theme/theme.module';
import { SysRoutingModule, routedComponents } from './sys-routing.module';
import { BasicService } from '../../@core/data/basic.service';
import { NotificationsService } from '../../@core/utils/notifications.service';
import { ToasterModule } from 'angular2-toaster';
import { SweetAlert2Module } from '@toverux/ngx-sweetalert2';
import { RoleModalComponent } from './role/modal/role.modal.component';
import { UserModalComponent } from './user/modal/user.modal.component';


const declarationsComponents = [
  RoleModalComponent,
  UserModalComponent,
];

const entryComponents = [
  RoleModalComponent,
  UserModalComponent,
];

@NgModule({
  imports: [
    ThemeModule,
    SysRoutingModule,
    Ng2SmartTableModule,
    ToasterModule,
    SweetAlert2Module.forRoot({
      type: 'warning',
      // background: '#554db3',
      showCancelButton: true,
      confirmButtonText: '确认',
      cancelButtonText: '取消',
  }),
  ],
  declarations: [
    ...routedComponents,
    ...declarationsComponents,
  ],
  providers: [
    BasicService,
    NotificationsService,
  ],
  entryComponents: [
    ...entryComponents,
  ],
})
export class SysModule { }
